package com.ym.medical.domain.param;

import com.ym.common.annotations.CustomConstraint;
import com.ym.common.constant.BeanCovert;
import com.ym.common.enums.UserUserTypeEnum;
import com.ym.medical.domain.entity.InformationEntity;
import com.ym.medical.enums.InformationInforStateEnum;
import com.ym.medical.enums.InformationInforTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

import static com.ym.common.constant.ValidRule.Add;
import static com.ym.common.constant.ValidRule.Update;

/**
 * 平台公告、医生接单后回复了你的消息、退款成功通知、医生发布的新话题对象 information
 *
 * @author ym
 * @date 2020-08-21
 */
@ApiModel("平台公告、医生接单后回复了你的消息、退款成功通知、医生发布的新话题-修改")
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class InformationUpdateParam extends BeanCovert<InformationEntity>{

    @ApiModelProperty("主键")
    @NotNull(message = "主键不能为空", groups = {Add.class, Update.class})
    private Long id;

    @ApiModelProperty("消息类别")
    @Size(max = 6, message = "消息类别长度超过{max}", groups = {Add.class, Update.class})
    @CustomConstraint(InformationInforTypeEnum.class)
    private String inforType;

    @ApiModelProperty("消息状态")
    @Size(max = 6, message = "消息状态长度超过{max}", groups = {Add.class, Update.class})
    @CustomConstraint(InformationInforStateEnum.class)
    private String inforState;

    @ApiModelProperty("发送时间")
    @NotNull(message = "发送时间不能为空", groups = {Add.class, Update.class})
    private Date sendTime;

    @ApiModelProperty("发送对象")
    private Long sendObjId;

    @ApiModelProperty("接受对象")
    private Long receiverObjId;

    @ApiModelProperty("消息标题")
    @Size(max = 50, message = "消息标题长度超过{max}", groups = {Add.class, Update.class})
    private String inforTitle;

    @ApiModelProperty("消息内容")
    @Size(max = 4000, message = "消息内容长度超过{max}", groups = {Add.class, Update.class})
    private String inforData;

    @ApiModelProperty("消息URL")
    @Size(max = 1024, message = "消息URL长度超过{max}", groups = {Add.class, Update.class})
    private String srcUrl;

    @ApiModelProperty("目的地")
    @Size(max = 2, message = "目的地长度超过{max}", groups = {Add.class, Update.class})
    @CustomConstraint(UserUserTypeEnum.class)
    private String destination;

    @ApiModelProperty("消息扩展内容(josn格式)")
    @Size(max = 10000, message = "消息扩展内容长度超过{max}", groups = {Add.class, Update.class})
    private String extContent;

}
